package com.athuiju.eduservice.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.metadata.CellData;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ExcelListener  extends AnalysisEventListener<DemoDate> {

    //创建list集合封装最终的数据
    List<DemoDate> list = new ArrayList<DemoDate>();

    //一行一行读取excel内容
    @Override
    public void invoke(DemoDate demoDate, AnalysisContext analysisContext) {
        System.out.println("***"+demoDate);
        list.add(demoDate);
    }

    //读取表头中的内容
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头："+headMap);
    }

    //读取完成后做的事情
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
